package com.devops


class StageResult {
    String name
    String status
    String startTime
    String endTime
    String duration
    String errorMessage
    
    @Override
    String toString() {
        return """Stage: ${name}
Status: ${status}
Start Time: ${startTime}
End Time: ${endTime}
Duration: ${duration}
Error: ${errorMessage ?: 'None'}
"""
    }
    
    // 转换为Map以便序列化
    Map toMap() {
        return [
            name: name,
            status: status,
            startTime: startTime,
            endTime: endTime,
            duration: duration,
            errorMessage: errorMessage
        ]
    }
}
